<template>
    <Form :model="leaveAppMessage" :label-width="80">
        <FormItem label="申请人">
              <Input v-model="leaveAppMessage.procDefId" ></Input>
              <Input v-model="leaveAppMessage.userId" ></Input>
              <Input v-model="leaveAppMessage.userName" ></Input>
        </FormItem>
        <FormItem label="请假类型">
            <Select v-model="leaveAppMessage.type">
                <Option value="1001">事假</Option>
                <Option value="1002">病假</Option>
                <Option value="1003">年假</Option>
            </Select>
        </FormItem>
        <FormItem label="请假时间">
            <Row>
                <Col span="6">
                    <DatePicker type="date" placeholder="请假开始日期" v-model="leaveAppMessage.startDate"></DatePicker>
                </Col>
                <Col span="6">
                    <DatePicker type="date" placeholder="请假截止日期" v-model="leaveAppMessage.endDate"></DatePicker>
                </Col>
            </Row>
        </FormItem>
        <FormItem label="请假事由：">
            <Input v-model="leaveAppMessage.reason" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="Enter something..."></Input>
        </FormItem>
        <FormItem>
            <Button type="primary" @click="startLeaveApp">Submit</Button> 
            <Button type="ghost" style="margin-left: 8px">Cancel</Button>
        </FormItem>
    </Form>
</template>

<script>
export default {
  data() {
    return {

        leaveAppMessage: {
           procDefId: this.$route.params.procDefId,
           userId: localStorage.getItem("userId"),
           userName: localStorage.getItem("username"),
           type:'1002',
           startDate:'2018-05-23',
           endDate:'2018-05-25',
           reason: '无理由'
        }
    }
  },
  created() {
    
  },
  mounted() {
    
  },
  methods: {
    startLeaveApp() {

    console.log("submit");
      this.$http
        .post("/flow/la/start",this.leaveAppMessage)
        .then(res => {
          if(res.retHead.code == '0000000'){
            
          }
        });
    },
  }
};
</script>

